home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / global / bullethit.scr < prev    next >
Encoding:
Text File  |  2002-10-21  |  3.4 KB  |  158 lines

  1. // Required parameters:
  2. //    local.direction - Direction vector
  3. //    local.damage - Number of hit points' damage to inflict
  4. //    local.knockback - Amount of force
  5. //    local.location - Location/bodypart, either one of the bodypart names or the corresponding integer
  6.  
  7. start local.direction local.damage local.knockback local.location:
  8. switch (local.location)
  9. {
  10. case "Unknown":
  11. case -1:
  12.     local.locationint = -1
  13.     break
  14. case "Pelvis":
  15. case 0:
  16.     local.locationint = 0
  17.     break
  18. case "Spine":
  19. case 1:
  20.     local.locationint = 1
  21.     break
  22. case "Spine1":
  23. case 2:
  24.     local.locationint = 2
  25.     break
  26. case "Spine2":
  27. case 3:
  28.     local.locationint = 3
  29.     break
  30. case "Neck":
  31. case 4:
  32.     local.locationint = 4
  33.     break
  34. case "Head":
  35. case 5:
  36.     local.locationint = 5
  37.     break
  38. case "RUpperArm":
  39. case 6:
  40.     local.locationint = 6
  41.     break
  42. case "RForearm":
  43. case 7:
  44.     local.locationint = 7
  45.     break
  46. case "RHand":
  47. case 8:
  48.     local.locationint = 8
  49.     break
  50. case "LUpperArm":
  51. case 9:
  52.     local.locationint = 9
  53.     break
  54. case "LForearm":
  55. case 10:
  56.     local.locationint = 10
  57.     break
  58. case "LHand":
  59. case 11:
  60.     local.locationint = 11
  61.     break
  62. case "RThigh":
  63. case 12:
  64.     local.locationint = 12
  65.     break
  66. case "RCalf":
  67. case 13:
  68.     local.locationint = 13
  69.     break
  70. case "RFoot":
  71. case 14:
  72.     local.locationint = 14
  73.     break
  74. case "LThigh":
  75. case 15:
  76.     local.locationint = 15
  77.     break
  78. case "LCalf":
  79. case 16:
  80.     local.locationint = 16
  81.     break
  82. case "LFoot":
  83. case 17:
  84.     local.locationint = 17
  85.     break
  86. default:
  87.     local.locationint = -1
  88.     println "Bad location parameter supplied to bullethit.scr"
  89.     break
  90. }
  91.  
  92. // Create a damage event with the parameters I want
  93. self damage NULL local.damage NULL (0 0 0) local.direction (0 0 0) local.knockback 16 17 local.locationint
  94.  
  95. /////////////////////////////////////
  96. // info
  97. /////////////////////////////////////
  98.  
  99. // Means of death values:
  100. // 0    MOD_NONE,
  101. // 1    MOD_SUICIDE,
  102. // 2    MOD_CRUSH,
  103. // 3    MOD_CRUSH_EVERY_FRAME,
  104. // 4    MOD_TELEFRAG,
  105. // 5    MOD_LAVA,
  106. // 6    MOD_SLIME,
  107. // 7    MOD_FALLING,
  108. // 8    MOD_LAST_SELF_INFLICTED,
  109. // 9    MOD_EXPLOSION,
  110. // 10    MOD_EXPLODEWALL,
  111. // 11    MOD_ELECTRIC,
  112. // 12    MOD_ELECTRICWATER,
  113. // 13    MOD_THROWNOBJECT,
  114. // 14    MOD_BEAM,
  115. // 15    MOD_ROCKET,
  116. // 16    MOD_IMPACT,
  117. // 17    MOD_BULLET,
  118. // 18    MOD_FAST_BULLET,
  119. // 19    MOD_VEHICLE,
  120. // 20    MOD_FIRE,
  121. // 21    MOD_FLASHBANG,
  122. // 22    MOD_ON_FIRE,
  123. // 23    MOD_GIB,
  124. // 24    MOD_IMPALE,
  125. // 25    MOD_BASH,
  126. // 26    MOD_TOTAL_NUMBER
  127.  
  128. // Location values
  129. // -1 Unknown
  130. // 0 Pelvis
  131. // 1 Spine
  132. // 2 Spine1
  133. // 3 Spine2
  134. // 4 Neck
  135. // 5 Head
  136. // 6 RUpperArm
  137. // 7 RForearm
  138. // 8 RHand
  139. // 9 LUpperArm
  140. // 10 LForearm
  141. // 11 LHand
  142. // 12 RThigh
  143. // 13 RCalf
  144. // 14 RFoot
  145. // 15 LThigh
  146. // 16 LCalf
  147. // 17 LFoot
  148.  
  149. // Damage flags (just add together the values for the flags you want).
  150. // (These are haxedecimal values, hence 0x0001 = 1, 0x0002 = 2, 0x0010 = 16, 0x040 = 16*4 = 64
  151. // #define DAMAGE_RADIUS            0x00000001    // damage was indirect   
  152. // #define DAMAGE_NO_ARMOR            0x00000002    // armour does not protect from this damage   
  153. // #define DAMAGE_ENERGY            0x00000004    // damage is from an energy based weapon   
  154. // #define DAMAGE_NO_KNOCKBACK        0x00000008    // do not affect velocity, just view angles   
  155. // #define DAMAGE_BULLET            0x00000010    // damage is from a bullet (used for ricochets)   
  156. // #define DAMAGE_NO_PROTECTION        0x00000020    // armor, shields, invulnerability, and godmode have no effect   
  157. // #define DAMAGE_NO_SKILL            0x00000040    // damage is not affected by skill level   
  158.